package com.starlink.model.util;

import com.starlink.model.dtomapper.UserChildDtoMapper;
import com.starlink.model.domain.UserChildDO;
import com.starlink.model.vo.UserChildVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class UserChildConvert {

    public static List<UserChildVO> buildUserChildVoList(List<UserChildDO> userChildDOList) {
        if (CollectionUtils.isEmpty(userChildDOList)) {
            return Lists.newArrayList();
        }
        List<UserChildVO> userChildVOList = new ArrayList<>();
        for (UserChildDO userChildDO : userChildDOList) {
            userChildVOList.add(UserChildDtoMapper.INSTANCE.do2VO(userChildDO));
        }

        return userChildVOList;
    }
}
